home *** CD-ROM | disk | FTP | other *** search
/ Internet 53 / INTERNET53.iso / pc / software / windows / building / coldfusion studio evaluation / data1.cab / CFS_Wizards / CFML / Verity_VSearchResult.wml < prev    next >
Encoding:
Text File  |  1998-10-08  |  2.7 KB  |  96 lines

  1. <WIZIF not ParameterExists('URLPath')>
  2.     <WIZSET URLPath = ''>
  3. </WIZIF>
  4.  
  5. <!--- template settings --->
  6. <CFSET SearchDirectory = "$${WorkingDirectory}">
  7. <CFSET SearchCollection = "$${Collection}">
  8. <CFSET UseURLPath = "<WIZIF URLPath EQ ''>NO<WIZELSE>YES</WIZIF>">
  9.  
  10.  
  11.  
  12. <!--- retrieve requested files --->
  13. <CFSEARCH 
  14.     name = "GetResults"
  15.     collection = "#SearchCollection#"
  16.     criteria = "#Form.Criteria#"
  17.     maxRows = "#Evaluate(Form.MaxRows + 1)#"
  18.     startRow = "#Form.StartRow#"
  19. >
  20.  
  21.  
  22.  
  23. <HTML><HEAD>
  24.     <TITLE>$${ApplicationName} - Search Results</TITLE>
  25. </HEAD><BODY bgcolor="ffffff">
  26.  
  27. <FONT size="+1">$${ApplicationName}</FONT> <BR>
  28. <FONT size="+2"><B>Search Results</B></FONT>
  29.  
  30. <P>
  31.  
  32. <!--- no files found for specified criteria? --->
  33. <CFIF GetResults.RecordCount is 0>
  34.     <B>No files found for specified criteria</B>
  35.  
  36. <!--- ... else at least one file found --->
  37. <CFELSE>
  38.  
  39.     <TABLE cellspacing=0 cellpadding=2>
  40.  
  41.     <!--- table header --->
  42.     <TR bgcolor="cccccc">
  43.         <TD><B>No</B></TD>
  44.         <TD><B>Score</B></TD>
  45.         <TD><B>File</B></TD>
  46.         <TD><B>Title</B></TD>
  47.     </TR>
  48.  
  49.     <CFOUTPUT query="GetResults" maxRows="#Form.MaxRows#">
  50.     <TR bgcolor="#IIf(CurrentRow Mod 2, DE('ffffff'), DE('ffffcf'))#">
  51.  
  52.         <!--- current row information --->
  53.         <TD>#Evaluate(Form.StartRow + CurrentRow - 1)#</TD>
  54.  
  55.         <!--- score --->
  56.         <TD>#Score# </TD>
  57.  
  58.         <!--- file name with the link returning the file --->
  59.         <TD>
  60.             <CFIF UseURLPath>    <!--- URL parameter from cfsearch contains URL path info --->
  61.                 <CFSET href = Replace(URL, " ", "%20", "ALL")>
  62.             <CFELSE>            <!--- ... else use OpenFile to return the file --->
  63.                 <CFSET href = "MyApplication_VOpenFile.cfm?serverFilePath=#URLEncodedFormat(Key)#">
  64.             </CFIF>
  65.             <A href="#href#">#GetFileFromPath(Key)#</A>
  66.         </TD>
  67.  
  68.         <!--- title for HTML files --->
  69.         <TD>#Title# </TD>
  70.  
  71.     </TR>
  72.     </CFOUTPUT>
  73.  
  74.     </TABLE>
  75.  
  76.  
  77.     <!--- CFSEARCH tried to retrieve one more file than the number specified in the
  78.         Form.MaxRows parameter. If number of retrieved files is greater than MaxRows
  79.         we know that there is at least one file left. The following form contains only
  80.         one button which reloads this template with the new StartRow parameter. --->
  81.  
  82.     <CFIF GetResults.RecordCount gt Form.MaxRows>
  83.         <FORM action="$${SafeApplicationName}_VSearchResult.cfm" method="post">
  84.         <CFOUTPUT>
  85.             <INPUT type="hidden" name="Criteria" value="#Replace(Form.Criteria, """", "'", "ALL")#">
  86.             <INPUT type="hidden" name="MaxRows" value="#Form.MaxRows#">
  87.             <INPUT type="hidden" name="StartRow" value="#Evaluate(Form.StartRow + Form.MaxRows)#">
  88.             <INPUT type="submit" value="    More ...   ">
  89.         </CFOUTPUT>
  90.         </FORM>
  91.     </CFIF>
  92.  
  93. </CFIF>
  94.  
  95. </BODY></HTML>
  96.